import React from 'react'
import {connect} from 'dva'           
import BasicLayout from './../layouts/BasicLayout'

class Home extends React.Component{
	render(){   
		return (
            <BasicLayout 
                currentUser={this.props.user}
                onLogout={this.handleLogout.bind(this)}
            />
		)
    }
    handleLogout(event){       
        this.props.dispatch({
            type:"app/logout",
            payload:this.props.user
        })
    }
}

export default connect(function(state){
	return {
		user:state.app.user
	}
})(Home)